import axios from '@/request/http' // 导入http中创建的axios实例
import { commonOutDTO } from '@/api/common.d'
import {
  excuteFpscInputDTO,
  confirmFpscInputDTO,
  confirmFpscOutputDTO,
  applyFpscInputDTO,
  applyFpscOutputDTO,
  uploadInputDTO,
} from '@/api/wjfw-dto'
export default class wjfwService {
  /**
   * 执行分片上传
   * @param data
   * @returns
   */
  static excuteFpsc(data: any): Promise<commonOutDTO<null>> {
    return axios.post('/api/lswj/fpwj/excuteFpsc', data)
  }

  /**
   * 确认分片上传
   * @param data
   * @returns
   */
  static confirmFpsc(data: confirmFpscInputDTO): Promise<commonOutDTO<confirmFpscOutputDTO>> {
    return axios.post('/api/lswj/fpwj/confirmFpsc', data)
  }

  /**
   * 申请分片上传
   * @param data
   * @returns
   */
  static applyFpsc(data: applyFpscInputDTO): Promise<commonOutDTO<applyFpscOutputDTO>> {
    return axios.post('/api/lswj/fpwj/applyFpsc', data)
  }

  /**
   * 上传单文件
   * @param data
   * @returns
   */
  static upload(data: any): Promise<commonOutDTO<confirmFpscOutputDTO>> {
    return axios.post('/fpi/lswj/dwj/upload', data)
  }
}
